﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demos.DesignPatterns._08_桥接模式
{
    /// <summary>
    /// 具体运输方式：陆运
    /// </summary>
    public class GroundShipping:ShippingMethod
    {
        private string _waybillNumber;

        public GroundShipping(ILogisticsCompany company) : base(company) { }

        public override void PrepareShipment()
        {
            Console.WriteLine("准备陆运货物：检查车辆状态，安排装货");
            _waybillNumber = _logisticsCompany.CreateWaybill();
        }

        public override void ExecuteShipping()
        {
            Console.WriteLine($"开始陆运运输：{_logisticsCompany.GetCompanyName()} 运单号：{_waybillNumber}");
        }

        public override void CompleteShipping()
        {
            Console.WriteLine($"陆运完成：签收确认，结算费用 {_logisticsCompany.CalculateFreight(100, 2):C}");
        }

    }
}
